﻿@model OTE.Web.Mvc.ViewModels.Category.CreateCategoryViewModel
<script type="text/javascript" src="@Url.Script("jquery.validate.min.js")"></script>
<link href="@Url.Css("tabs.css")" rel="stylesheet" type="text/css" />
<!-- start id-form -->
<div class="maincontent clearfix">
    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th valign="top">
                Parent category:
            </th>
            <td>
                @Html.DropDownListFor(model => model.Category.ParentId, new SelectList(Model.ParentCategories, "Id", "Name"), " ", new { id = "ddlParentCat", name = "ddlParentCat" })
            </td>
        </tr>
        <tr>
            <th valign="top">
                Name:
            </th>
            <td>
                @Html.TextBoxFor(x => x.Category.Name, new { @class = "inp-form" })
            </td>
        </tr>
    </table>
    <!-- end id-form  -->
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#infoForm").validate({
            rules:
            {
                Name: { required: true }
            },
            messages:
            {
                Name: { required: 'Please input name.' }
            },
            errorElement: "div"
        })
    });
</script>